
RexxScriptEngine
Copyright 2010 Stani Ryabenkiy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


=====================================================================


The RexxScriptEngine 


COMPILATION
===========

Compilation requires the classpath to contain the javax.script API 
(provided by Java 6 or by other packages such as BSF 3.0) as well as 
the Servlet API and JSP API (provided by most servlet containers.

The included Ant build script (build.xml) can be used to compile and
package the script engine into a Jar file. It requires Java 6 and 
references the BSF jar, which has been included in the binary distribution 
but must be provided separately in the source distribution.

The code uses features of Java 5 such as the enhanced for-loop and thus
depends on Java 5 as minimum Java version (if the javax.script API is
provided through means other than Java 6). 


DEPLOYMENT
==========

Make the Jar file containing the discovery mechanism descriptor and 
engine classes available to the application's classpath.

Place BSF 2.4 on the application's classpath.

Install Open Object Rexx (ooRexx) for your platform. ooRexx is available
for major platforms, including Linux and Windows, and can be obtained
at http://www.oorexx.org/

Install BSF4ooRexx. BSF4ooRexx can be obtained at 
http://wi.wu-wien.ac.at/rgf/rexx/bsf4oorexx/current/

In order to work correctly, the program will need access to the BSF4ooRexx
native binaries distributed with BSF4ooRexx. These should be installed
with BSF4ooRexx but can also be packaged separately with the application.

Optionally, in order to interface between Java objects and Rexx, scripts
should include the BSF.CLS file. This can be achieved by ending scripts
with the line “::REQUIRES BSF.CLS”. The BSF4ooRexx distribution includes
documentation about using this functionality.




USAGE
=====

Using the RexxScriptEngine to execute Rexx scripts is identical to using
 any other JSR-223 compliant script engine. The language string to be 
used with the script engine discovery mechanism is “rexx”.

For example,

ScriptEngine engine = new ScriptEngineManager().getEngineByName("rexx");
engine.eval("say hello rexx");

will print "HELLO REXX" so standard output.

